text: Use the widget y coordinate for gestures
authorAlexander Mikhaylenko <alexm@gnome.org>
Fri, 23 Jul 2021 09:15:43 +0000 (14:15 +0500)
committerAlexander Mikhaylenko <alexm@gnome.org>
Fri, 23 Jul 2021 18:37:36 +0000 (23:37 +0500)
commit00cc99818d649ac0f77dd1c637d78967aba5d8e5
treee979fbfba804fa27ca0f05940d054f8137723798
parent8d5ef4ab30e9ecb8b897711e3a2ca67428abea0c
text: Use the widget y coordinate for gestures

Currently we use layout coordinates and widget height when determining
where a click or drag has happened. If the widget has top padding (which it
does inside a GtkEntry, for example), the area where it's possible to select
text is shifted down, so the part of GtkText above the layout is not counted
as the draggable area and instead the equal area below the widget is counted.

Since GtkText is always single-line, there's no need to do any of that and
we can use widget coordinates. Then the draggable area matches the widget
and the problems goes away.
gtk/gtktext.c